<template>
<div>
 <List :nameList="nameList">
   <template #header>
     <h2>学生列表</h2>
   </template>

   <template v-slot:content="{nameList}">
     <ul>
       <li v-for="item in nameList" :key="item.id">
         {{item.name}} -- {{item.age}}
       </li>
     </ul>
   </template>
 </List>
</div>
</template>


<script>
import List from "@/components/List";
export default {
  name:"App",
  components: {List},
  data(){
    return{
      nameList:[
        {id:"001",name:"张三",age:12},
        {id:"002",name:"李四",age:22},
        {id:"003",name:"王五",age:32},
        {id:"004",name:"赵六",age:25},
        {id:"005",name:"颜七",age:24},
      ]
    }
  }
}
</script>


<style></style>